# type id
SetChunkSizeId = 1
AbortMessageId = 2
AckId = 3
UserControlMessagesId = 4
WindowAckSizeId = 5
SetPeerBandwidthId = 6
TransactionID = 1  # 响应 _result 数据用 恒值为1
NetConnectionResult = "_result"

# 长度
ChunkStreamIdLen = 1
TimeStampLen = 3
BodySizeLen = 3
TypeIdLen = 1
StreamIdLen = 4
BodyLen = 4
LimitTypeLen = 1
AmfTypeLen = 1
AmfStrLen = 2
AmfIntLen = 8
AmfBoolLen = 1
AmfBoolTrue = 1
AmfBoolFalse = 0
TransactionIDLen = 8
AmfEndLen = 3
StreamBegin = 1
StreamBeginLen = 6

ConnectEnd = b"\x00\x00\x09"
Connect = "connect"
CreateStream = "createStream"
Publish = "publish"
Pull = "capabilities"
Play = "play"
PlayCreeateStream = b'\x00\x00\x05'
PlayEnd = b'\x00\x00\x0b\xb8'
SetDataFrameChunkId = 4
SetDataFrameTypeId = 18
AmfEnd = 9

MsgHead = {
    "ChuckStreamId": {"len": ChunkStreamIdLen, "value": 2},
    "TimeStamp": {"len": TimeStampLen, "value": 0},
    "BodySize": {"len": BodySizeLen, "value": 0},
    "TypeId": {"len": TypeIdLen, "value": 0},
    "StreamId": {"len": StreamIdLen, "value": 0}
}

AmfType = {
    int: 0,
    bool: 1,
    str: 2,
    dict: 3,
    None: 5,
    list: 8

}
AmfTypeValue = {
    0: int,
    1: bool,
    2: str,
    3: dict,
    5: None,
    8: list,
}
